package edu.ycu.aladdin.web.utils;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @author <a href="mailto:wangruihuano@gmail.com">王瑞环</a>
 * @since 1.0
 */
public class StringUtils {

    /**
     * 移除字符串中的空格,制表符和换行符
     * @param str
     * @return
     */
    public static String removeAllBlankChar(String str){
        String dest = "";
        if (str!=null) {
            Pattern p = Pattern.compile("\\s*|\t|\r|\n");
            Matcher m = p.matcher(str);
            dest = m.replaceAll("");
        }
        return dest;
    }

    private StringUtils() {}
}
